{% extends "layout2.html" %} 
{% block leftbody %}
<article id="96" class="post">

	<header class="post-head">
		<h1 class="post-title">{{blog.title}}</h1> {% if session.cur_user_id == blog.userid %}
		<a href="{{url_for('edit_blog', blogid=blog.blogid)}}"><span class="label label-info">bianji</span></a>

		<a href="{{url_for('del_blog', blogid=blog.blogid)}}"><span class="label label-danger">delete</span></a> {% endif %}
		<section class="post-meta">
			<span class="author">作者：<a href="/author/wangsai/">{{blog.name}}</a></span> &bull;
			<time class="post-date">{{blog.created_date}}</time>
		</section>
	</header>

	<section class="post-content">
		<p>{{blog.text|safe}}</p>

	</section>

</article>
</br>
</br>
{% if session.logged_in %}
<form action="{{ url_for('comment', blogid=blog.blogid) }}" method="post" class="comment-form">
	<div class="form-group">
		<label for="comment">评论</label>
		<textarea name=text class="form-control" rows="3" id="comment"></textarea>
	</div>
	<button type="submit" class="btn btn-info">发表评论</button>
</form>
{% endif %}
</br>
<label>评论列表：</label>
<div>
	<ul class="comments">
		{% for comment in comments %}
		<li>
			<h5>Writen by user:{{ comment.name }}</h5>
			<p>{{ comment.comment_text }}</p>
		</li>
		{% endfor %}
	</ul>
</div>

{% endblock %}